package usaco.c2009.february.bronze;

import java.math.BigInteger;
import java.util.Scanner;

/*
 * p3195
 * USACO 2009 February - Bronze
 */

public class p3195 {

	static String N, P, R;
	static BigInteger BN, BP, BR;

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		N = scanner.next();
		P = scanner.next();
		
		BN = new BigInteger(N);
		BP = new BigInteger(P);
		BR = BigFastPower(BN, BP);
		R = BR.toString();
		
		int len = R.length();
		for (int i=0;i<len;++i) {
			System.out.print(R.charAt(i));
			if (i % 70 == 69 || i == len - 1) {
				System.out.println();
			}
		}
		
		
	}

	private static BigInteger BigFastPower(BigInteger n, BigInteger p) {

		BigInteger res = BigInteger.ONE;
		BigInteger tmp = BigInteger.ONE;
		BigInteger two = BigInteger.ONE.add(BigInteger.ONE);
		
		while (p.compareTo(BigInteger.ONE) > 0) {
//			System.out.println(n + " " + p + " " + tmp);
			if (p.mod(two).compareTo(BigInteger.ONE) == 0) {
				// not divisible by 2
				tmp = tmp.multiply(n);
			}
			else {
				// divisible by 2
				
			}
			p = p.divide(two);
			n = n.multiply(n);
		}
		res = n .multiply(tmp);
		return res;
	}

}
